package com.momo.hotel.service.impl;

import com.momo.hotel.dao.mapping.TbCommonProblemsMapper;
import com.momo.hotel.dao.mapping.TbQuestionMapper;

import com.momo.hotel.dao.pojo.TbCommonProblems;
import com.momo.hotel.dao.pojo.TbQuestion;
import com.momo.hotel.service.QuestionService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author qiang
 * @create 2019/7/4
 */
@Service
public class QuestionServiceImpl implements QuestionService {
    @Resource
    TbQuestionMapper tbQuestionMapper;
    @Resource
    TbCommonProblemsMapper tbCommonProblemsMapper;

    /**
     * 客户提问
     *
     * @param tbQuestion
     * @return
     */
    @Override
    public Integer addQuestion(TbQuestion tbQuestion) {
        return tbQuestionMapper.insert(tbQuestion);
    }

    /**
     * 常见问题
     *
     * @return
     */
    @Override
    public List<TbCommonProblems> selectCommonProblems() {
        return tbCommonProblemsMapper.selectAll();
    }
}
